# 提示输入圆的半径，计算出圆的周长和面积：
# 如果输入负数和或0，提示半径不能为负数或0
# 计算结果保留2位

pi = 3.1415926


def check(num: str):
    try:
        if type(float(num)) is float and float(num) > 0:
            return True
        else:
            return False
    except:
        False


def area(r: float):
    global pi
    return pi * (r**2)


def perimeter(r: float):
    global pi
    return 2 * pi * r


# print("面积为：%.2f，周长为%.2f" % (area, l))

if __name__ == "__main__":
    num = input("输入半径:")
    if check(num):
        num = float(num)
        a = area(num)
        b = perimeter(num)
        print("面积为：%.2f，周长为%.2f" % (a, b))
    else:
        print("输入正确的半径,大于0的数")
